import request from '@/utils/request'

// 查询课程分类列表
export function listCategory(query) {
  return request({
    url: '/courseManagement/category/list',
    method: 'get',
    params: query
  })
}

// 根据校区查询课程分类列表
export function listCategoryByCampusId(campusId) {
  return request({
    url: '/courseManagement/category/listByCampusId',
    method: 'get',
    params: { campusId }
  })
}

// 查询校区列表
// export function listCampus(query) {
//   return request({
//     url: '/courseManagement/category/campusList',
//     method: 'get',
//     params: query
//   })
// }

// 查询课程分类详细
export function getCategory(categoryId) {
  return request({
    url: '/courseManagement/category/' + categoryId,
    method: 'get'
  })
}

// 新增课程分类
export function addCategory(data) {
  return request({
    url: '/courseManagement/category',
    method: 'post',
    data: data
  })
}

// 修改课程分类
export function updateCategory(data) {
  return request({
    url: '/courseManagement/category',
    method: 'put',
    data: data
  })
}

// 删除课程分类
export function delCategory(categoryId) {
  return request({
    url: '/courseManagement/category/' + categoryId,
    method: 'delete'
  })
}
